<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: xi
  Date: 2015/10/18
  Time: 9:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8"/>
    <title></title>
    <link rel="stylesheet" type="text/css" href="../css/BSindex.css"/>
    <link rel="stylesheet" type="text/css" href="../css/main.css"/>
    <script src="../js/BSindex.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript"  src="/fruits/js/jq.js"></script>
    <c:if test="${sessionScope.usersInfo==null}">
        <script type="text/javascript">
            $(function () {
                location.href="/fruits/ShowUsersServlet?pageNum=1" ;
            });
        </script>
    </c:if>
</head>
<body>
<div class="mean">
    <div class="logo">
        <a href="index.jsp"><img src="/fruits/img/alogo.png" alt=""/></a>
    </div>

    <jsp:include page="menu.jsp"></jsp:include>

</div>

<div class="gong" id="x1">
    <div class="con">
        <div class="tit">
            <ul>
                <li>用户名</li>
                <li class="i">&nbsp;</li>
                <li>邮箱</li>
                <li class="i">&nbsp;</li>
                <li>手机</li>
                <li class="i">&nbsp;</li>
                <li>操作</li>
            </ul>
        </div>

        <c:forEach items="${sessionScope.usersInfo.list}" var="user">
            <div class="info">
                <ul>
                    <li><a href="">${user.username}</a></li>
                    <li class="i">&nbsp;</li>
                    <li><a href="">${user.email}</a></li>
                    <li class="i">&nbsp;</li>
                    <li><a href="">${user.tel}</a></li>
                    <li class="i">&nbsp;</li>
                    <li><a href="/fruits/DeleteUserServlet?uid=${user.uid}">删除</a></li>
                </ul>
            </div>
        </c:forEach>
        <c:if test="${usersInfo.hasPreviousPage}">
            <a href="/fruits/ShowUsersServlet?pageNum=${usersInfo.pageNum-1}">上一页</a>
        </c:if>
        <c:if test="${usersInfo.hasNextPage}">
            <a href="/fruits/ShowUsersServlet?pageNum=${usersInfo.pageNum+1}">下一页</a>
        </c:if>
    </div>
</div>

</body>
<script type="text/javascript">
    function isDelete(uid) {
        console.log(uid);
        if (confirm("确定删除吗？")){
            location.href="/fruits/DeleteUserServlet?uid="+uid;
        }
    }
</script>
</html>

